3.779 \(\int \sqrt{\frac{1-\cos (x)}{a-\cos (x)}} \, dx\)

Optimal. Leaf size=65 \[ -\frac{2 \sqrt{\frac{1-\cos (x)}{a-\cos (x)}} \sqrt{a-\cos (x)} \tan ^{-1}\left (\frac{\sin (x)}{\sqrt{1-\cos (x)} \sqrt{a-\cos (x)}}\right )}{\sqrt{1-\cos (x)}} \]

[Out]

(-2*ArcTan[Sin[x]/(Sqrt[1 - Cos[x]]*Sqrt[a - Cos[x]])]*Sqrt[(1 - Cos[x])/(a - Cos[x])]*Sqrt[a - Cos[x]])/Sqrt[
1 - Cos[x]]

________________________________________________________________________________________

Rubi [A]  time = 0.0999325, antiderivative size = 65, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.158, Rules used = {4400, 2775, 204} \[ -\frac{2 \sqrt{\frac{1-\cos (x)}{a-\cos (x)}} \sqrt{a-\cos (x)} \tan ^{-1}\left (\frac{\sin (x)}{\sqrt{1-\cos (x)} \sqrt{a-\cos (x)}}\right )}{\sqrt{1-\cos (x)}} \]

Antiderivative was successfully verified.

[In]

Int[Sqrt[(1 - Cos[x])/(a - Cos[x])],x]

[Out]

(-2*ArcTan[Sin[x]/(Sqrt[1 - Cos[x]]*Sqrt[a - Cos[x]])]*Sqrt[(1 - Cos[x])/(a - Cos[x])]*Sqrt[a - Cos[x]])/Sqrt[
1 - Cos[x]]

Rule 4400

Int[(u_.)*((v_)^(m_.)*(w_)^(n_.))^(p_), x_Symbol] :> With[{uu = ActivateTrig[u], vv = ActivateTrig[v], ww = Ac
tivateTrig[w]}, Dist[(vv^m*ww^n)^FracPart[p]/(vv^(m*FracPart[p])*ww^(n*FracPart[p])), Int[uu*vv^(m*p)*ww^(n*p)
, x], x]] /; FreeQ[{m, n, p}, x] &&  !IntegerQ[p] && ( !InertTrigFreeQ[v] ||  !InertTrigFreeQ[w])

Rule 2775

Int[Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]/Sqrt[(c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]], x_Symbol] :> Dist[
(-2*b)/f, Subst[Int[1/(b + d*x^2), x], x, (b*Cos[e + f*x])/(Sqrt[a + b*Sin[e + f*x]]*Sqrt[c + d*Sin[e + f*x]])
], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0]

Rule 204

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTan[(Rt[-b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[-b, 2]), x] /
; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int \sqrt{\frac{1-\cos (x)}{a-\cos (x)}} \, dx &=\frac{\left (\sqrt{\frac{1-\cos (x)}{a-\cos (x)}} \sqrt{a-\cos (x)}\right ) \int \frac{\sqrt{1-\cos (x)}}{\sqrt{a-\cos (x)}} \, dx}{\sqrt{1-\cos (x)}}\\ &=\frac{\left (2 \sqrt{\frac{1-\cos (x)}{a-\cos (x)}} \sqrt{a-\cos (x)}\right ) \operatorname{Subst}\left (\int \frac{1}{-1-x^2} \, dx,x,\frac{\sin (x)}{\sqrt{1-\cos (x)} \sqrt{a-\cos (x)}}\right )}{\sqrt{1-\cos (x)}}\\ &=-\frac{2 \tan ^{-1}\left (\frac{\sin (x)}{\sqrt{1-\cos (x)} \sqrt{a-\cos (x)}}\right ) \sqrt{\frac{1-\cos (x)}{a-\cos (x)}} \sqrt{a-\cos (x)}}{\sqrt{1-\cos (x)}}\\ \end{align*}

Mathematica [A]  time = 0.068058, size = 64, normalized size = 0.98 \[ -\sqrt{2} \csc \left (\frac{x}{2}\right ) \sqrt{\frac{\cos (x)-1}{\cos (x)-a}} \sqrt{\cos (x)-a} \log \left (\sqrt{\cos (x)-a}+\sqrt{2} \cos \left (\frac{x}{2}\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[(1 - Cos[x])/(a - Cos[x])],x]

[Out]

-(Sqrt[2]*Sqrt[(-1 + Cos[x])/(-a + Cos[x])]*Sqrt[-a + Cos[x]]*Csc[x/2]*Log[Sqrt[2]*Cos[x/2] + Sqrt[-a + Cos[x]
]])

________________________________________________________________________________________

Maple [A]  time = 0.5, size = 67, normalized size = 1. \begin{align*} -{\frac{\sqrt{2}\sin \left ( x \right ) }{-1+\cos \left ( x \right ) }\sqrt{{\frac{-1+\cos \left ( x \right ) }{-a+\cos \left ( x \right ) }}}\sqrt{-2\,{\frac{-a+\cos \left ( x \right ) }{\cos \left ( x \right ) +1}}}\arctan \left ({\frac{\sqrt{2}}{2}\sqrt{-2\,{\frac{-a+\cos \left ( x \right ) }{\cos \left ( x \right ) +1}}}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((1-cos(x))/(a-cos(x)))^(1/2),x)

[Out]

-2^(1/2)*((-1+cos(x))/(-a+cos(x)))^(1/2)*sin(x)*(-2*(-a+cos(x))/(cos(x)+1))^(1/2)*arctan(1/2*2^(1/2)*(-2*(-a+c
os(x))/(cos(x)+1))^(1/2))/(-1+cos(x))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((1-cos(x))/(a-cos(x)))^(1/2),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.55248, size = 100, normalized size = 1.54 \begin{align*} -\arctan \left (-\frac{{\left (a - 2 \, \cos \left (x\right ) - 1\right )} \sqrt{-\frac{\cos \left (x\right ) - 1}{a - \cos \left (x\right )}}}{2 \, \sin \left (x\right )}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((1-cos(x))/(a-cos(x)))^(1/2),x, algorithm="fricas")

[Out]

-arctan(-1/2*(a - 2*cos(x) - 1)*sqrt(-(cos(x) - 1)/(a - cos(x)))/sin(x))

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((1-cos(x))/(a-cos(x)))**(1/2),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((1-cos(x))/(a-cos(x)))^(1/2),x, algorithm="giac")

[Out]

Timed out